cmake_minimum_required(VERSION 3.0.2)
project(pilz_tutorial)
add_compile_options(-std=c++17)

find_package(catkin REQUIRED COMPONENTS
	moveit_core
	moveit_ros_planning
	moveit_ros_planning_interface
)

find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED system filesystem date_time thread)
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES 
  CATKIN_DEPENDS moveit_core moveit_ros_planning moveit_ros_planning_interface
  DEPENDS system_lib
)

include_directories(
	include
  ${catkin_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIR} 
  ${EIGEN3_INCLUDE_DIRS}
)

add_executable(pilz_record src/pilz_record.cpp src/pilz_base.cpp)
add_executable(pilz_replay src/pilz_replay.cpp src/pilz_base.cpp)

add_dependencies(pilz_record ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(pilz_replay ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(pilz_record ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES} ${JSONCPP_LIBRARIES})
target_link_libraries(pilz_replay ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN3_LIBRARIES} ${JSONCPP_LIBRARIES})
